﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace ZJF.CrossThread
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            FrmChild frm = new FrmChild();
            frm.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Thread t = new Thread(() =>
            {
                string msg = this.textBox2.Text.Trim();
                Console.WriteLine(msg);
                this.textBox1.Text = msg;
            });
            t.IsBackground= true;
            t.Start();
        }
    }
}
